]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot-ui: Make screenshots appear in recent items
authorIvan Molodetskikh <yalterz@gmail.com>
Mon, 11 Oct 2021 07:17:08 +0000 (10:17 +0300)
committerMarge Bot <marge-bot@gnome.org>
Thu, 27 Jan 2022 22:25:42 +0000 (22:25 +0000)
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1954>

js/ui/screenshot.js

index 41a4dfe16ef0d4d53b18495890adf4f94ed68010..c6b4c1387f6424494b1eb742ed372a314f93ec47 100644 (file)
@@ -1,7 +1,7 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 /* exported ScreenshotService, ScreenshotUI, showScreenshotUI */
 
-const { Clutter, Gio, GObject, GLib, Meta, Shell, St } = imports.gi;
+const { Clutter, Gio, GObject, GLib, Gtk, Meta, Shell, St } = imports.gi;
 
 const GrabHelper = imports.ui.grabHelper;
 const Layout = imports.ui.layout;
@@ -1586,6 +1586,9 @@ class ScreenshotUI extends St.Widget {
             }
         }
 
+        // Add it to recent files.
+        Gtk.RecentManager.get_default().add_item(file.get_uri());
+
         // Show a notification.
         const source = new MessageTray.Source(
             // Translators: notification source name.